package test1;

import java.sql.Connection;
import java.sql.Statement;

public class JDBCDemo1 {
    public static void main(String[] args) {
        //使用静态的sql语句时，需要使用statement 对象

        //获取连接对象
        try (
                Connection connection=DBUtil.getConnection();
                ){
            //获取执行SQL的对象
            Statement statement=connection.createStatement();
            String sql="UPDATE chatinfo SET content ='6666' WHERE id=1 ";

            int num=statement.executeUpdate(sql);
            if (num>0){
                System.out.println("修改成功");
            }

        }catch (Exception e){
            e.printStackTrace();
        }

    }
}
